package org.bronycorps.mlptss.manager;

import java.util.List;

import org.bronycorps.mlptss.manager.preferences.GameConfiguration;
import org.bronycorps.mlptss.manager.preferences.WavesConfiguration;
import org.bronycorps.mlptss.manager.preferences.WavesConfiguration.WaveConfiguration;

public class WaveFactory {

	private static List<WaveConfiguration> waves;

	private WavesConfiguration configuration;

	public WaveFactory() {
		super();
		this.configuration = GameConfiguration.getInstance()
				.getWavesConfiguration();

		waves = this.configuration.getWaveList();

	}

	public int getNextWaveId(int currentId) {
		return (currentId + 1) % waves.size();
	}

	public int getRandomWaveId() {
		return (int) (Math.random() * (waves.size() - 1));
	}

	public WaveConfiguration getWave(int id) {
		return waves.get(id);
	}
}
